package org.jeecg.modules.fk.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.config.annotations.OrgPermissionAnnotation;
import org.jeecg.config.util.CurrentOrgInfoUtil;
import org.jeecg.modules.fk.service.TaxpayerInfoService;
import org.jeecg.modules.fk.vo.req.DjZyxxRequest;
import org.jeecg.modules.qyxx.entity.BgNsrJbxx;
import org.jeecg.modules.qyxx.service.IBgNsrJbxxService;
import org.jeecg.modules.system.service.ISysDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 纳税人信息
 */
@RestController
@RequestMapping("/bgNsrJbxx")
public class BgNserJbxxController {

    @Autowired
    private IBgNsrJbxxService nsrJbxxService;

    /**
     * 用户主要信息查询
     *
     * @return
     */
    @AutoLog(value = "用户主要信息查询")
    @ApiOperation(value = "用户主要信息查询", notes = "用户主要信息查询")
    @RequestMapping(value = "/getOne", method = RequestMethod.POST)
    @OrgPermissionAnnotation
    public Result queryPageList(@Valid @RequestBody DjZyxxRequest djZyxxRequest) {
        String djxh = CurrentOrgInfoUtil.getCurrentOrgShxydm();
        LambdaQueryWrapper<BgNsrJbxx> wrapper = Wrappers.lambdaQuery(BgNsrJbxx.class); // industry_type
        wrapper.eq(BgNsrJbxx::getDjxh,djxh);
        BgNsrJbxx jbxx = nsrJbxxService.getOne(wrapper);
        // nsrJbxxService.getQyxq(djZyxxRequest.getNsrsbh());
        return Result.OK(jbxx);
    }
}
